<template>
  <el-container>
    <component :is="currentComponent" :elementId="elementId"  :perms="perms" :labelName="labelName"
               :addRecordLhsxbFlag="addRecordLhsxbFlag"
               :addRecordHjxwbFlag="addRecordHjxwbFlag"
               :addRecordStwhbFlag="addRecordStwhbFlag"
               :addRecordJkwhbFlag="addRecordJkwhbFlag"
               :addRecordHyxxbFlag="addRecordHyxxbFlag"
               :btName="btName"
               :showdata="showdata"></component>
<!--    <Lhsxb :elementId="elementId" :perms="perms"  :labelName="labelName" :Flag="addRecordLhsxbFlag" />-->
<!--    <Hjxwb :elementId="elementId" :perms="perms"  :labelName="labelName"  />-->
<!--    <Stwhb :elementId="elementId" :perms="perms" :labelName="labelName" />-->
<!--    <Jkwhb :elementId="elementId" :perms="perms"  :labelName="labelName"  />-->
<!--    <Hyxxb :elementId="elementId" :perms="perms"  :labelName="labelName" />-->
  </el-container>
</template>

<script>

    import Lhsxb from "./AddRecordEleAttr/Lhsxb";
    import Hjxwb from "./AddRecordEleAttr/Hjxwb";
    import Stwhb from "./AddRecordEleAttr/Stwhb";
    import Jkwhb from "./AddRecordEleAttr/Jkwhb";
    import Hyxxb from "./AddRecordEleAttr/Hyxxb";
    export default {
      name: "AddRecord",
      components: {Hyxxb, Jkwhb, Stwhb, Hjxwb, Lhsxb},
      props: {
        elementId: {
          type: String,
          default: ''
        },
        perms: '',
        addRecordLhsxbFlag: false,
        addRecordHjxwbFlag: false,
        addRecordStwhbFlag: false,
        addRecordJkwhbFlag: false,
        addRecordHyxxbFlag: false,
        labelName:'',
        btName:'',
        showdata:{}
      },
      data() {
        return {}
      },
      mounted(){
        console.log(this.addRecordLhsxbFlag,
          this.addRecordHjxwbFlag,
          this.addRecordStwhbFlag,
          this.addRecordJkwhbFlag,
          this.addRecordHyxxbFlag,
          this.btName)
          console.log(this.showdata)
      },
      computed:{
       currentComponent:function () {
         if(this.addRecordLhsxbFlag === true){
           return Lhsxb
         }else if(this.addRecordHjxwbFlag === true){
           return Hjxwb
         }else if(this.addRecordStwhbFlag === true){
           return Stwhb
         }else if(this.addRecordJkwhbFlag === true){
           return Jkwhb
         }else if(this.addRecordHyxxbFlag === true){
           return Hyxxb
         }
       }
      }


    }

</script>

<style scoped>

</style>
